<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of relativeProductWidget
 *
 * @author Lawrence
 */
class relativeProductWidget extends CWidget{
    
    public $category_id;
    public $id;
    
    public function run(){        
        $product = Product::model()->findAll(array(
            'condition' => 'category_id = :cat_id AND id <> :id',
            'params' => array(
                ':cat_id' => $this->category_id,
                ':id' => $this->id
            )   
        ));
        
        $this->render('relativeProductWidget', array(
            'product' => $product,            
        ));
    }
}

?>
